public class FingerGame {
    private Computer computer = new Computer();
    private Player player = new Player();

    public static void main(String[] args) {
        FingerGame fingerGame = new FingerGame();
        fingerGame.run();
    }

    public void run() {
        int score = 0;
        for (int i = 0; i < 10; i++) {
            System.out.println("第" + (i + 1) + "局开始！");
            computer.generate();
            int computerNumber = computer.getNumber();
            player.generate();
            int playerNumber = player.getNumber();
            if (computerNumber == playerNumber) {
                System.out.println("平局，不加分，当前得分为：" + score);
            } else if ((playerNumber - computerNumber) == 1) {
                score += 3;
                System.out.println("赢了，加3分，当前得分为：" + score);
            } else if ((playerNumber - computerNumber) == 2) {
                score -= 1;
                System.out.println("输了，扣1分,当前得分为：" + score);
            } else if ((playerNumber - computerNumber) == -1) {
                score -= 1;
                System.out.println("输了，扣1分,当前得分为：" + score);
            } else if ((playerNumber - computerNumber) == -2) {
                score += 3;
                System.out.println("赢了，加3分，当前得分为：" + score);
            }
        }
        if (score > 0) {
            System.out.println("恭喜你赢了！总得分为：" + score);
        } else {
            System.out.println("很遗憾你输了...得分为:" + score);
        }
    }

}
